package com.qy139.auth.controller;


import com.qy139.auth.service.ITabRoleMenuService;
import com.qy139.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 角色和菜单关联表 前端控制器
 * </p>
 *
 * @author yuhaochen
 * @since 2021-12-01
 */
@RestController
@RequestMapping("/tab-role-menu")
public class TabRoleMenuController {
    @Resource
    private ITabRoleMenuService roleMenuService;

    //查询资源
    @GetMapping("/findMidByRid/{id}")
    public Result findMidByRid(@PathVariable Integer id){
        return roleMenuService.findMenuIdByRoleId(id);
    }

    //分配资源
    @PostMapping("/addMenu")
    public Result addMenu(Integer id, String menusId){
        return roleMenuService.addMenu(id,menusId);
    }
}

